package com.example.soft.demos.web;

public class Student {
    private final String name;
    private final int preferredQuantity;
    private final PaperType preferredType;

    public Student(String name, int preferredQuantity, PaperType preferredType) {
        if (name == null || preferredQuantity < 1) {
            throw new IllegalArgumentException("学生姓名不可为空，偏好数量需≥1");
        }
        this.name = name;
        this.preferredQuantity = preferredQuantity;
        this.preferredType = preferredType;
    }

    public String getName() {
        return name;
    }

    public int getPreferredQuantity() {
        return preferredQuantity;
    }

    public PaperType getPreferredPaperType() {
        return preferredType;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", preferredQuantity=" + preferredQuantity +
                ", preferredType=" + preferredType +
                '}';
    }
}